﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Timetable.Base.Entities;
using Timetable.Base.Interfaces.Repositories;
using Ninject;
using Timetable.Base.Interfaces.Validators;

namespace Timetable.Data.Services.DataServices
{
    public class CourseService: BaseDataService<Course>
    {
        [Inject]
        public IRepository<Course> CourseRepository { get; set; }

        [Inject]
        public IValidator<Course> CourseVlidator { get; set; }

        public override IRepository<Course> Repository
        {
            get { return CourseRepository; }
        }

        public override Base.Interfaces.Validators.IValidator<Course> Validator
        {
            get { return CourseVlidator; }
        }

        public override IQueryable<Course> All()
        {
            return CourseRepository.Get(orderBy: order => order.OrderBy(f => f.Id));
        }

        public override Course GetById(int id)
        {
            return CourseRepository.GetById(id);
        }
    }
}
